#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

// system
#include "sys.h"

// components
#include "function.h"
#include "logger.h"
#include "mshell.h"
#include "Ringbuf16.h"
#include "ymodem.h"
#include "ymodem_fs.h"
#include "at_client.h"

// device
#include "device.h"
#include "template.h"
#include "serial.h"
#include "flash.h"
// #include "cat1.h"

//fs
#include "fatfs.h"

#define APP_VERSION_CODE			(0x01)			//网关软件程序	版本号
#define APP_VERSION_NAME			"V1.0.1"		//网关软件程序	版本名称

#define	APP_ADDR						0x08010000
#define BOOT_INFO_ADDR                  0x0800F000
#define	APP_BACKUP_ADDR					0x00000000

typedef struct
{    
    uint8_t check_code;    
    char dname[16];
    uint32_t disk_addr;
    uint32_t file_length;
}OTA_INFO_t;

typedef struct
{
    uint8_t version;
    uint8_t step;
    uint8_t is_app_alive;
    uint8_t error_count;

    OTA_INFO_t app;
    OTA_INFO_t backup;
}BOOT_INFO_t;

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
